import { DynamicModule, Module } from '@nestjs/common';
import { SmsService } from './sms.service';
import { SmsController } from './sms.controller';
import { TX_SMS_MODULE_OPTIONS } from './sms.constants';
import { TXSmsOptions } from './sms.interface';

@Module({})
export class TXSmsModule {
  static register(options: TXSmsOptions): DynamicModule {
    return {
      module: TXSmsModule,
      providers: [
        { provide: TX_SMS_MODULE_OPTIONS, useValue: options },
        SmsService,
      ],
      controllers: [SmsController],
    };
  }
}
